#pragma once
#include "PropertiesWnd.h"
#include "MeasureStation.h"
#include "EtchChecker.h"


// CEtchCheckWnd

class CEtchCheckWnd : public CDockablePane
{
	DECLARE_DYNAMIC(CEtchCheckWnd)

public:
	CEtchCheckWnd();
	virtual ~CEtchCheckWnd();

  void AdjustLayout(void);
  void EnableAll(BOOL bEnable);

public:
  void SetVSDotNetLook(BOOL bSet)
  {
    m_wndPropList.SetVSDotNetLook(bSet);
    m_wndPropList.SetGroupNameFullWidth(bSet);
  }

public:
  void StationSwitch_slot(CMeasureStation* station);
  void EtchAdded_slot(CEtchChecker *c);
  void EtchDeleting_slot(CEtchChecker *c);
  void EtchDeleted_slot(void);
  void ObjAdd_slot(const draw_obj* obj);
  void ObjDelete_slot(const draw_obj* obj);
  void TemplateCSChanged_slot(void);

protected:
	DECLARE_MESSAGE_MAP()

protected:
  void InitPropList();
  void SetPropListFont();

protected:
  afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  afx_msg void OnSize(UINT nType, int cx, int cy);
  afx_msg void OnExpandAllProperties();
  afx_msg void OnUpdateExpandAllProperties(CCmdUI* pCmdUI);
  afx_msg void OnSortProperties();
  afx_msg void OnUpdateSortProperties(CCmdUI* pCmdUI);
  afx_msg void OnSetFocus(CWnd* pOldWnd);
  afx_msg void OnSettingChange(UINT uFlags, LPCTSTR lpszSection);
  afx_msg LRESULT OnPropertyChanged(WPARAM wParam, LPARAM lParam);
  afx_msg void OnAngleBoxROI();
  afx_msg void OnUpdateAngleBoxROI(CCmdUI* pCmdUI);
  afx_msg void OnAnnulusArcROI();
  afx_msg void OnUpdateAnnulusArcROI(CCmdUI* pCmdUI);
  afx_msg void OnPloygonROI();
  afx_msg void OnUpdatePolygonROI(CCmdUI* pCmdUI);
  afx_msg void OnEditROI();
  afx_msg void OnUpdateEditROI(CCmdUI* pCmdUI);
  afx_msg void OnAdd();
  afx_msg void OnUpdateAdd(CCmdUI* pCmdUI);
  afx_msg void OnDelete();
  afx_msg void OnUpdateDelete(CCmdUI* pCmdUI);
  afx_msg void OnCheckSelChange();
  afx_msg void OnUpdateCheckComboBox(CCmdUI* pCmdUI);
  afx_msg void OnPreview();
  afx_msg void OnPreview(CCmdUI* pCmdUI);
  afx_msg void OnSave();
  afx_msg void OnUpdateSave(CCmdUI* pCmdUI);

protected:
  CFont m_fntPropList;
  CPropertiesToolBar m_wndToolBar;
  CComboBox m_wndCombo;
  CMFCPropertyGridCtrl m_wndPropList;

public:
  CWnd* ImageView;

private:
  CMeasureStation* station_;
  CEtchChecker* checker_;
  boost::signals2::connection obj_delete_signal_connection_;

  CMFCPropertyGridProperty *etch_;
  CMFCPropertyGridProperty *etch_min_gray_;
  CMFCPropertyGridProperty *etch_max_gray_;
  CMFCPropertyGridProperty *etch_area_threshold_;

  CMFCPropertyGridProperty *background_;
  CMFCPropertyGridProperty *background_min_gray_;
  CMFCPropertyGridProperty *background_max_gray_;
  CMFCPropertyGridProperty *background_noise_radius_;
};


